﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;

namespace RAMED
{
    class SendMail
    {

        public static void Send(string from, string to, string Subject, string htmlText)
        {
            MailMessage oMail = new MailMessage();
            SmtpClient oSmtp = new SmtpClient("smtp.gmail.com",587);

            oSmtp.DeliveryMethod = SmtpDeliveryMethod.Network;
            oSmtp.UseDefaultCredentials = false;

            oMail = new MailMessage( from,


            to,

 
           Subject,

         htmlText);

        


            oMail.IsBodyHtml = true;

            oSmtp.Credentials = new NetworkCredential(

            "",
             "");
            oSmtp.EnableSsl = true;
  


            try
            {
               
                oSmtp.Send( oMail);
                //Console.WriteLine("email was sent successfully!");
            }
            catch (Exception ep)
            {
               // NotificationTest.NotificationManager nm = new NotificationTest.NotificationManager();
                 
                //Console.WriteLine("failed to send email with the following error:");
                //Console.WriteLine(ep.Message);
            }
        }
    }
}
